using Core.Domain.Entities;
using FluentNHibernate.Mapping;

namespace DataMain.Mappings
{
  public class ElectionMap : ClassMap<Election>
  {
    public ElectionMap()
    {
      Id(x => x.Id);
      Map(x => x.ElectionDate);
      Map(x => x.ElectionType);
      References(x => x.InCommunity);
      HasMany(x => x.Voters).Inverse().Cascade.All();
      HasMany(x => x.VoteRecipients).Inverse().Cascade.All();
    }
  }
}